import { applyDecorators, SetMetadata, UseGuards } from '@nestjs/common'
import { JwtAuthGuard } from '../modules/user/guards/jwt-auth.guard'
import { RoleGuard } from '../modules/user/guards/role.guard'

export const Auth = (permissions: string) => {
  return applyDecorators(SetMetadata('permission', permissions), UseGuards(JwtAuthGuard, RoleGuard))
}
